#include "book.h"
#include "status.h"
#include <stdio.h>
#define maxsize 50


typedef struct{
	book *elem;
	int length;
}mgmt_bk_sqlist;

status mgmt_bk_init(mgmt_bk_sqlist *l);

status mgmt_bk_insert(mgmt_bk_sqlist *l,book b);

status mgmt_bk_delete_name(mgmt_bk_sqlist *l,char *name);

status mgmt_bk_delete_id(mgmt_bk_sqlist *l,int *id);

status mgmt_bk_edit(mgmt_bk_sqlist *l,int *id,book bk_new);

status mgmt_bk_find(mgmt_bk_sqlist *l,char *bid,book **res);

void print_book(book b);

typedef int (*func_cmp)(book,book);
int cmp_by_null(book a,book b);
int cmp_by_name(book a,book b);
int cmp_by_price(book a,book b);
status mgmt_bk_traverse(mgmt_bk_sqlist *l,func_cmp op);
